package com.dslcode.cloud.provider.order.service;

import com.dslcode.cloud.common.dto.order.OrderPayDTO;
import com.dslcode.cloud.common.model.order.OrderPay;
import com.dslcode.cloud.provider.order.mapper.OrderPayMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by dongsilin on 2017/9/25.
 */
@Slf4j
@Service
public class OrderPayService {

    @Autowired
    private OrderPayMapper orderPayMapper;

    @Transactional
    public OrderPay save(OrderPay orderPay){
        this.orderPayMapper.save(orderPay);
        return orderPay;
    }

    public List<OrderPayDTO> findAll() {
        return orderPayMapper.findAll();
    }

}
